package com.situ.mall.pattern.factory;

import org.junit.jupiter.api.Test;

public class Client {
    public static void main(String[] args) {
        AbstractCal cal = new Add();
        cal.getResult();
        cal = new Sub();
        cal.getResult();
    }

    @Test
    public void test1() {
        AbstractCal cal = CalFactory.createCal(1);
        cal.getResult();
        cal = CalFactory.createCal(2);
        cal.getResult();

    }

    @Test
    public void test2() {
        AbstractCal cal = CalFactory.createCal();
        cal.getResult();
    }
}
